Page({
    data: {
      userName:'',
      userIcon:''
    },
    onLoad: function (options) {
          this.initdata()
    },
    onShow:function(){
      this.initdata()
    },
    address(){
      wx.navigateTo({
        url: '../addresslist/addresslist',
      })
    },
    login(){
      wx.navigateTo({
        url: '../login/login',
      })
    },
    initdata(){
      let userInfo=wx.getStorageSync('userInfo')
        if(userInfo){
          this.setData({
              userName:userInfo.nick_name,
              userIcon:userInfo.icon
          })
        }
    },
    toOrder(){
      wx.navigateTo({
        url: '../order/order',
      })
    },
    Cou(){
      wx.navigateTo({
        url: '../coupons/coupons',
      })
    },
    toInfo(){
      wx.navigateTo({
        url: '../userinfo/userinfo',
      })
    }
});
